package com.unism.common.constant;

import java.util.regex.Pattern;

/**
 * Description: Base Constant
 * 
 * @author nileader / nileader@gmail.com
 * @Date Feb 15, 2012
 */
public class BaseConstant {

	/** mill seconds of one day */
	public static long MILLISECONDS_OF_ONE_DAY = 1000 * 60 * 60 * 24;

	public static final String REG_EXP_OF_IP = "([1-9]|[1-9]\\d|1\\d{2}|2[0-1]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}";
	/**
	 * Diff 文件中用于分隔不同文件的标志, 通过是这样: <br>
	 * Index:
	 * trunk/reviewboardtest/pagecache-webx3-ga-example/pagecache-webx3-ga
	 * -example-config/src/main/resources/common/page-cache.xml <br>
	 * =================================================================== <br>
	 * */
	public final static String REGEX_OF_DIFF_INDEX = "===================================================================";

	/** 包含IP */
	public static final String REG_EXP_OF_CONTAINS_IP = "((?s).*?)([1-9]|[1-9]\\d|1\\d{2}|2[0-1]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}((?s).*?)";
	public static final Pattern PATTERN_OF_CONTAINS_IP = Pattern
			.compile(REG_EXP_OF_CONTAINS_IP);
	
	public static final String[] EMPTY_STRING_ARRAY = new String[0];

	public static final Pattern KVP_PATTERN = Pattern
			.compile("([_.a-zA-Z0-9][-_.a-zA-Z0-9]*)[=](.*)"); // key value pair
																// pattern.

	public static final Pattern INT_PATTERN = Pattern.compile("^\\d+$");

}
